﻿/*
 * Copyright (c) 2016 The ZLToolKit project authors. All Rights Reserved.
 *
 * This file is part of ZLToolKit(https://github.com/ZLMediaKit/ZLToolKit).
 *
 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
 */

#include <cassert>
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#include <random>

#include "util.h"
#include "onceToken.h"
#include "Network/sockutil.h"

using namespace std;

namespace toolkit {


static inline uint64_t getCurrentMicrosecondOrigin() {
    return  std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
}

uint64_t getCurrentMillisecond(bool system_time) {
    std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
}

uint64_t getCurrentMicrosecond(bool system_time) {
    // static bool flag = initMillisecondThread();
    // if (system_time) {
    //     return s_currentMicrosecond_system.load(memory_order_acquire);
    // }
    // return s_currentMicrosecond.load(memory_order_acquire);
}

}  // namespace toolkit